/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.tools.idea.streaming.emulator

import java.awt.event.KeyEvent

/**
 * Mapping from AWT VK codes to DOM key names.
 * https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
 */
val VK_TO_DOM_KEY_NAME: Map<Int, String> = mapOf(
  KeyEvent.VK_0 to "0",
  KeyEvent.VK_1 to "1",
  KeyEvent.VK_2 to "2",
  KeyEvent.VK_3 to "3",
  KeyEvent.VK_4 to "4",
  KeyEvent.VK_5 to "5",
  KeyEvent.VK_6 to "6",
  KeyEvent.VK_7 to "7",
  KeyEvent.VK_8 to "8",
  KeyEvent.VK_9 to "9",
  KeyEvent.VK_A to "a",
  KeyEvent.VK_ACCEPT to "Accept",
  KeyEvent.VK_ADD to "+",
  KeyEvent.VK_AGAIN to "Again",
  KeyEvent.VK_ALL_CANDIDATES to "AllCandidates",
  KeyEvent.VK_ALPHANUMERIC to "Alphanumeric",
  KeyEvent.VK_ALT to "Alt",
  KeyEvent.VK_ALT_GRAPH to "AltGraph",
  KeyEvent.VK_AMPERSAND to "&",
  KeyEvent.VK_ASTERISK to "*",
  KeyEvent.VK_AT to "@",
  KeyEvent.VK_B to "b",
  KeyEvent.VK_BACK_QUOTE to "`",
  KeyEvent.VK_BACK_SLASH to "\\",
  KeyEvent.VK_BACK_SPACE to "Backspace",
  KeyEvent.VK_BEGIN to "",
  KeyEvent.VK_BRACELEFT to "{",
  KeyEvent.VK_BRACERIGHT to "}",
  KeyEvent.VK_C to "c",
  KeyEvent.VK_CANCEL to "Cancel",
  KeyEvent.VK_CAPS_LOCK to "CapsLock",
  KeyEvent.VK_CIRCUMFLEX to "^",
  KeyEvent.VK_CLEAR to "Clear",
  KeyEvent.VK_CLOSE_BRACKET to "]",
  KeyEvent.VK_CODE_INPUT to "CodeInput",
  KeyEvent.VK_COLON to ":",
  KeyEvent.VK_COMMA to ",",
  KeyEvent.VK_COMPOSE to "Compose",
  KeyEvent.VK_CONTEXT_MENU to "ContextMenu",
  KeyEvent.VK_CONTROL to "Control",
  KeyEvent.VK_CONVERT to "Convert",
  KeyEvent.VK_COPY to "Copy",
  KeyEvent.VK_CUT to "Cut",
  KeyEvent.VK_D to "d",
  KeyEvent.VK_DEAD_ABOVEDOT to "Dead",
  KeyEvent.VK_DEAD_ABOVERING to "Dead",
  KeyEvent.VK_DEAD_ACUTE to "Dead",
  KeyEvent.VK_DEAD_BREVE to "Dead",
  KeyEvent.VK_DEAD_CARON to "Dead",
  KeyEvent.VK_DEAD_CEDILLA to "Dead",
  KeyEvent.VK_DEAD_CIRCUMFLEX to "Dead",
  KeyEvent.VK_DEAD_DIAERESIS to "Dead",
  KeyEvent.VK_DEAD_DOUBLEACUTE to "Dead",
  KeyEvent.VK_DEAD_GRAVE to "Dead",
  KeyEvent.VK_DEAD_IOTA to "Dead",
  KeyEvent.VK_DEAD_MACRON to "Dead",
  KeyEvent.VK_DEAD_OGONEK to "Dead",
  KeyEvent.VK_DEAD_SEMIVOICED_SOUND to "Dead",
  KeyEvent.VK_DEAD_TILDE to "Dead",
  KeyEvent.VK_DEAD_VOICED_SOUND to "Dead",
  KeyEvent.VK_DECIMAL to ".",
  KeyEvent.VK_DELETE to "Delete",
  KeyEvent.VK_DIVIDE to "/",
  KeyEvent.VK_DOLLAR to "$",
  KeyEvent.VK_DOWN to "ArrowDown",
  KeyEvent.VK_E to "e",
  KeyEvent.VK_END to "End",
  KeyEvent.VK_ENTER to "Enter",
  KeyEvent.VK_EQUALS to "=",
  KeyEvent.VK_ESCAPE to "Escape",
  KeyEvent.VK_EURO_SIGN to "\u20ac",
  KeyEvent.VK_EXCLAMATION_MARK to "!",
  KeyEvent.VK_F to "f",
  KeyEvent.VK_F1 to "F1",
  KeyEvent.VK_F10 to "F10",
  KeyEvent.VK_F11 to "F11",
  KeyEvent.VK_F12 to "F12",
  KeyEvent.VK_F13 to "F13",
  KeyEvent.VK_F14 to "F14",
  KeyEvent.VK_F15 to "F15",
  KeyEvent.VK_F16 to "F16",
  KeyEvent.VK_F17 to "F17",
  KeyEvent.VK_F18 to "F18",
  KeyEvent.VK_F19 to "F19",
  KeyEvent.VK_F2 to "F2",
  KeyEvent.VK_F20 to "F20",
  KeyEvent.VK_F21 to "F21",
  KeyEvent.VK_F22 to "F22",
  KeyEvent.VK_F23 to "F23",
  KeyEvent.VK_F24 to "F24",
  KeyEvent.VK_F3 to "F3",
  KeyEvent.VK_F4 to "F4",
  KeyEvent.VK_F5 to "F5",
  KeyEvent.VK_F6 to "F6",
  KeyEvent.VK_F7 to "F7",
  KeyEvent.VK_F8 to "F8",
  KeyEvent.VK_F9 to "F9",
  KeyEvent.VK_FINAL to "FinalMode",
  KeyEvent.VK_FIND to "Find",
  KeyEvent.VK_FULL_WIDTH to "Zenkaku",
  KeyEvent.VK_G to "g",
  KeyEvent.VK_GREATER to "<",
  KeyEvent.VK_H to "h",
  KeyEvent.VK_HALF_WIDTH to "Hankaku",
  KeyEvent.VK_HELP to "Help",
  KeyEvent.VK_HIRAGANA to "Hiragana",
  KeyEvent.VK_HOME to "Home",
  KeyEvent.VK_I to "i",
  KeyEvent.VK_INPUT_METHOD_ON_OFF to "ModeChange",
  KeyEvent.VK_INSERT to "Insert",
  KeyEvent.VK_INVERTED_EXCLAMATION_MARK to "\u00A1",
  KeyEvent.VK_J to "j",
  KeyEvent.VK_JAPANESE_HIRAGANA to "Hiragana",
  KeyEvent.VK_JAPANESE_KATAKANA to "Katakana",
  KeyEvent.VK_JAPANESE_ROMAN to "Romaji",
  KeyEvent.VK_K to "k",
  KeyEvent.VK_KANA to "KanjiMode",
  KeyEvent.VK_KANA_LOCK to "KanaMode",
  KeyEvent.VK_KANJI to "KanjiMode",
  KeyEvent.VK_KATAKANA to "Katakana",
  KeyEvent.VK_KP_DOWN to "ArrowDown",
  KeyEvent.VK_KP_LEFT to "ArrowLeft",
  KeyEvent.VK_KP_RIGHT to "ArrowRight",
  KeyEvent.VK_KP_UP to "ArrowUp",
  KeyEvent.VK_L to "l",
  KeyEvent.VK_LEFT to "ArrowLeft",
  KeyEvent.VK_LEFT_PARENTHESIS to "(",
  KeyEvent.VK_LESS to ">",
  KeyEvent.VK_M to "m",
  KeyEvent.VK_META to "Meta",
  KeyEvent.VK_MINUS to "-",
  KeyEvent.VK_MODECHANGE to "ModeChange",
  KeyEvent.VK_MULTIPLY to "*",
  KeyEvent.VK_N to "n",
  KeyEvent.VK_NONCONVERT to "NonConvert",
  KeyEvent.VK_NUM_LOCK to "NumLock",
  KeyEvent.VK_NUMBER_SIGN to "#",
  KeyEvent.VK_NUMPAD0 to "0",
  KeyEvent.VK_NUMPAD1 to "1",
  KeyEvent.VK_NUMPAD2 to "2",
  KeyEvent.VK_NUMPAD3 to "3",
  KeyEvent.VK_NUMPAD4 to "4",
  KeyEvent.VK_NUMPAD5 to "5",
  KeyEvent.VK_NUMPAD6 to "6",
  KeyEvent.VK_NUMPAD7 to "7",
  KeyEvent.VK_NUMPAD8 to "8",
  KeyEvent.VK_NUMPAD9 to "9",
  KeyEvent.VK_O to "o",
  KeyEvent.VK_OPEN_BRACKET to "[",
  KeyEvent.VK_P to "p",
  KeyEvent.VK_PAGE_DOWN to "PageDown",
  KeyEvent.VK_PAGE_UP to "PageUp",
  KeyEvent.VK_PASTE to "Paste",
  KeyEvent.VK_PAUSE to "Pause",
  KeyEvent.VK_PERIOD to ".",
  KeyEvent.VK_PLUS to "+",
  KeyEvent.VK_PREVIOUS_CANDIDATE to "PreviousCandidate",
  KeyEvent.VK_PRINTSCREEN to "PrintScreen",
  KeyEvent.VK_PROPS to "Props",
  KeyEvent.VK_Q to "q",
  KeyEvent.VK_QUOTE to "'",
  KeyEvent.VK_QUOTEDBL to "\"",
  KeyEvent.VK_R to "r",
  KeyEvent.VK_RIGHT to "ArrowRight",
  KeyEvent.VK_RIGHT_PARENTHESIS to ")",
  KeyEvent.VK_ROMAN_CHARACTERS to "Romaji",
  KeyEvent.VK_S to "s",
  KeyEvent.VK_SCROLL_LOCK to "ScrollLock",
  KeyEvent.VK_SEMICOLON to ";",
  KeyEvent.VK_SHIFT to "Shift",
  KeyEvent.VK_SLASH to "/",
  KeyEvent.VK_SPACE to " ",
  KeyEvent.VK_STOP to "MediaStop",
  KeyEvent.VK_SUBTRACT to "-",
  KeyEvent.VK_T to "t",
  KeyEvent.VK_TAB to "Tab",
  KeyEvent.VK_U to "u",
  KeyEvent.VK_UNDERSCORE to "_",
  KeyEvent.VK_UNDO to "Undo",
  KeyEvent.VK_UP to "ArrowUp",
  KeyEvent.VK_V to "v",
  KeyEvent.VK_W to "w",
  KeyEvent.VK_WINDOWS to "Meta",
  KeyEvent.VK_X to "x",
  KeyEvent.VK_Y to "y",
  KeyEvent.VK_Z to "z")
